package com.mc.book.pojo.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

@ApiModel("用户")
public class RequestUser {

    Integer id;
    @ApiModelProperty("用户openid")
    String openid;
    @ApiModelProperty("用户手机号")
    String user_phone;
    @ApiModelProperty("用户密码")
    String user_pass;
    @ApiModelProperty("验证码key")
    String validatekey;
    @ApiModelProperty("验证码code")
    String validateCode;
    @ApiModelProperty("用户token")
    String token;
    Integer user_status = 0;
    @ApiModelProperty("0非会员 1会员")
    Integer is_vip = 0;
    @ApiModelProperty("0非合伙人 1合伙人")
    Integer is_partner = 0;
    @ApiModelProperty("会员有效期")
    Date vip_time;

    @ApiModelProperty("注册时间")
    Date reg_time;

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Date getReg_time() {
        return reg_time;
    }

    public void setReg_time(Date reg_time) {
        this.reg_time = reg_time;
    }

    public String getUser_pass() {
        return user_pass;
    }

    public void setUser_pass(String user_pass) {
        this.user_pass = user_pass;
    }

    public Date getVip_time() {
        return vip_time;
    }

    public void setVip_time(Date vip_time) {
        this.vip_time = vip_time;
    }

    public Integer getIs_vip() {
        return is_vip;
    }

    public void setIs_vip(Integer is_vip) {
        this.is_vip = is_vip;
    }

    public Integer getIs_partner() {
        return is_partner;
    }

    public void setIs_partner(Integer is_partner) {
        this.is_partner = is_partner;
    }

    public Integer getUser_status() {
        return user_status;
    }

    public void setUser_status(Integer user_status) {
        this.user_status = user_status;
    }

    public String getUser_phone() {
        return user_phone;
    }

    public void setUser_phone(String user_phone) {
        this.user_phone = user_phone;
    }

    public String getValidatekey() {
        return validatekey;
    }

    public void setValidatekey(String validatekey) {
        this.validatekey = validatekey;
    }

    public String getValidateCode() {
        return validateCode;
    }

    public void setValidateCode(String validateCode) {
        this.validateCode = validateCode;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Boolean loginCheckFields() {

        if (
                user_phone == null || user_phone.isEmpty() ||
                        user_pass == null || user_pass.isEmpty()
                ) {
            return false;
        }
        return true;
    }

    public Boolean infoCheckFields() {

        if (
                token == null || token.isEmpty()
        ) {
            return false;
        }
        return true;
    }

    public Boolean regCheckFields() {

        if (
                user_phone == null || user_phone.isEmpty() ||
                user_pass == null || user_pass.isEmpty()   ||
                validatekey == null || validatekey.isEmpty()
        ) {
            return false;
        }
        return true;
    }

}
